#include <netinet/in.h>
#include <unistd.h>
#include <linux/ip.h>
#include <netinet/ip6.h>
#include <linux/tcp.h>
#include <linux/udp.h>

#include "test_dpi_task2.h"
#include "log.h"
#include "protocols.h"
#include "mem.h"
#include "packet_ops.h"
#include "core_data.h"

int test_dpi_ops2(struct msg *msg)
{
	log_info("begin test_dpi_ops.");

	return 0;
}

void *test_dpi_loop2(void *data)
{
	log_info("begin test_dpi_loop.");
	packet_init();

	while (1) {
		void *data = get_packet(PROTOCOL_ICMP, NULL);
		if (data == NULL) {
			sleep(1);
			continue;
		}

		printf("I'm test B, I want to get ICMP packet, and now I get it.\n");
		usleep(100);

		free_packet();
	}
}
